import service from './request'

export function getNoPagedCollegeStage(queryinfo) {
    let url = queryinfo ? '/college_stages?queryinfo='+queryinfo :  '/college_stages'
    return service.get(url)
}
// 根据学院id获取学院的阶段
export function getCollegeStageByCollegeId(college_id){
    return service.get('/college_stages?queryinfo=nopaging&college_id='+college_id)

}
// 根据id获取阶段信息
export function getCourseStageById(id){
    return service.get('/college_stages/'+id)
}
// 根据id修改阶段信息
export function editCourseStageById(id,params){
    return service.put('/college_stages/'+id,params)
}
export function getCollegeStage(params) {
    let {pagenum,pagesize,department_id}=params
    console.log(params)
    if (department_id){
        return service.get('/college_stages?page='+pagenum+'&page_size='+pagesize+'&college_id='+department_id)
    }
    else{
        return service.get('/college_stages?page='+pagenum+'&page_size='+pagesize)
    }
}

export function createCollegeStage(data) {
    return service.post('/college_stages',data)
}